import type { ParkAddParamsType, ParkDataType, ParkParamsType } from "@/types/parkBuilding"
import { myGet, myPost, myRequest } from "@/utils/reuqest"

// 获取楼宇列表API
export const getParkListAPI = (params: ParkParamsType) => {
    return myGet<ParkDataType>('/park/building', params)
}

// 添加楼宇
export const addParkAPI = (data: ParkAddParamsType) => {
    return myPost('/park/building', data)
}

// 编辑楼宇
export const editParkAPI = (data: ParkAddParamsType & { id: number }) => {
    return myRequest({
        url: '/park/building',
        method: 'PUT',
        data
    })
}

// 删除楼宇
export const deleteParkAPI = (id: number) => {
    return myRequest({
        url: `/park/building/${id}`,
        method: 'DELETE'
    })
}